﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

namespace AimGameEngine.NodeEditorObject
{
    partial class PropretyTackCamera : Form
    {
        NodeTackCamera tackcamera;
        public PropretyTackCamera(NodeTackCamera tackcamera)
        {
            InitializeComponent();
            this.tackcamera = tackcamera;

            this.numSpeed.Value = (decimal)tackcamera.speed;
            
            this.numTop.Value = (decimal)tackcamera.Bounder.X;
            this.numBottom.Value = (decimal)tackcamera.Bounder.Y;
            this.numLeft.Value = (decimal)tackcamera.Bounder.Width;
            this.numRight.Value = (decimal)tackcamera.Bounder.Height;

            this.numAreaX.Value = (decimal)tackcamera.Area.X;
            this.numAreaY.Value = (decimal)tackcamera.Area.Y;
            this.numAreaWidth.Value = (decimal)tackcamera.Area.Width;
            this.numAreaHeight.Value = (decimal)tackcamera.Area.Height;

            this.comboBox1.SelectedIndex = Convert.ToInt32(tackcamera.ShowDebugCamera);
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            tackcamera.speed = (float)this.numSpeed.Value;

            tackcamera.Bounder.X = (int)this.numTop.Value;
            tackcamera.Bounder.Y = (int)this.numBottom.Value;
            tackcamera.Bounder.Width = (int)this.numLeft.Value;
            tackcamera.Bounder.Height = (int)this.numRight.Value;

            tackcamera.Area.X = (int)this.numAreaX.Value;
            tackcamera.Area.Y = (int)this.numAreaY.Value;
            tackcamera.Area.Width = (int)this.numAreaWidth.Value;
            tackcamera.Area.Height = (int)this.numAreaHeight.Value;

            tackcamera.ShowDebugCamera = Convert.ToBoolean(this.comboBox1.SelectedIndex);
        }

    }
}
